#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
#include <string.h>
#include <math.h>

int my_atoi(char* str)
{
	int ret = 0;
	for (int i = 0; i < strlen(str) - 1; i++)
	{
		ret += (str[strlen(str) - 2 - i] - '0') * (int)pow(10, i);
	}
	return ret;
}

int main()
{
	int i;
	char buffer[256];
	printf("Enter a number: ");
	fgets(buffer, 256, stdin);
	i = my_atoi(buffer);
	printf("The value entered is %d. Its double is %d.\n", i, i * 2);
	return 0;
}